<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>GAE App Test</title>
	<script type="text/javascript" src="/js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript">
	   jQuery.noConflict();
	</script>
	<script type="text/javascript" src="/js/highcharts/highcharts.js"></script>
	<script type="text/javascript" src="/js/highcharts/gray.js"></script>
	<script type="text/javascript" src="/js/highcharts/testing-stock-exporting.js"></script>
	<script type="text/javascript" src="/js/jquery.combobox.packed.js"></script>	
  </head>
  <body>
	<div id="container" class="highcharts-container" style="height:410px; margin: 0 2em; clear:both; min-width: 600px">
	</div>	
	<div style="margin: 10 35 10 35"/>
		Plot: <select id="testList"  onchange="javascript:updateChart()">
		</select>	
		<a href="/ktrwjr/index.html"> tests...</a>
		<a href="/PlotData?runTest=true&category=entity&testName=all&">Entity</a>
		<a href="/PlotData?runTest=true&category=transaction&testName=all&">Transaction</a>
		<a href="/PlotData?runTest=true&category=blob&testName=all&">Blob</a>
		<a href="/PlotData?runTest=true&category=file&testName=all&">File</a>
		<p/>
		<table cellpadding="5">
			<tr>
				<td align="right">
					Local: 
				</td>
				<td>
					<a href="http://localhost:8888/_ah/admin/datastore">Datastore</a>
				</td>
				<td>
					<a href="http://localhost:8888/">App</a>
				</td>
			</tr>
			<tr>
				<td align="right">
				Master Slave: 
				</td>
				<td>
					<a href="https://appengine.google.com/datastore/explorer?&app_id=s~apptestms">Datastore</a>
				</td>
				<td>
					<a href="http://apptestms.appspot.com">App</a>
				</td>
			<tr>
				<td align="right">
					High Replication: 
				</td>
				<td>
					<a href="https://appengine.google.com/datastore/explorer?&app_id=s~apptesthr">Datastore</a>
				</td>
				<td>
					<a href="http://apptesthr.appspot.com">App</a>
				</td>
			</tr>
			<tr>
				<td align="right">
					Source Code:
				</td>
				<td>
					<a href="http://code.google.com/p/gae-app-test/">gae-app-test</a>
				</td>
				<td>
				</td>
			</tr>
			<tr>
				<td align="right">
					Links:
				</td>
				<td>
					<a href="https://developers.google.com/cloud-sql">Cloud SQL</a>
				</td>
				<td>
				</td>
			</tr>

			<tr>
				<td align="right">
					Author:
				</td>
				<td>
					<a href="http://www.linkedin.com/in/mikelawrence">Mike Lawrence</a>
				</td>
				<td>
				</td>
			</tr>
		</table>
				 
	</div>
	<script type="text/javascript">
		function updateChart() {
			var	test =jQuery('#testList').val();
			// alert(test)
			if (test != null) {
				jQuery.getJSON(test, function(data) {
					//alert(data);
					// Update the chart
					window.chart = new Highcharts.StockChart({
						chart : {
							renderTo : 'container'
						},
						rangeSelector : {
							selected : 1
						},
						title : {
							text : 'GAE Performance'
						},
						series : [{
							name : jQuery('#testList option:selected').text(),
							data : data,
							tooltip: {
								yDecimals: 2
							}
						}]
					});
				});
			}
		}

		jQuery(document).ready(function() {	
			// Get chartable test list
			jQuery.ajax({
				url: "/PlotData?testList=true",
				success: function(data){
					//alert(data)
					jQuery("#testList").html(data);
					var selected = jQuery("#testList option:first").val()
					jQuery("#testList").val(selected); 
					updateChart()
				}
			});
		});
	</script>
	</body>
</html>


